package com.lingyue.commons.constants;

import java.util.ArrayList;
import java.util.List;

/**
 * 标签类型：车辆标签 / 客户标签
 *
 * @author deep.wu
 * @version 1.0 on 2020/1/13
 */
public class TagType {

    public static final String VEH_STR = "VEH";
    public static final String CUS_STR = "CUS";

    public static List<String> getOptionList() {
        List<String> resultList = new ArrayList<>();
        resultList.add(VEH_STR);
        resultList.add(CUS_STR);
        return resultList;
    }

    public enum ConnectedEnum {
        /**
         * enum
         */
        VEH(VEH_STR, "车辆标签"),
        CUS(CUS_STR, "客户标签"),

        ;

        String code;
        String text;

        ConnectedEnum(String code, String text) {
            this.code = code;
            this.text = text;
        }

        public String code() {
            return this.code;
        }

        public String text() {
            return this.text;
        }

        public static String getText(String code) {
            for (ConnectedEnum item : ConnectedEnum.values()) {
                if (item.code().equals(code)) {
                    return item.text();
                }
            }
            return "";
        }
    }
}